import { defineStore } from 'pinia'
import { handleTree, handleAsyncRoutes } from '@/utils';


export const useMenuStore = defineStore('main', {
  state: (): any => {
    return {
      menulist: []
    }
  },
  actions: {
     async GET_MENU(bool?: boolean) {
      let menu = sessionStorage.getItem('menu-router')
      if (bool || !menu) {
        // // // const data = 
        // // const newMenu = handleAsyncRoutes(handleTree(data, 'id', 'title', 'sId', 'sIdTitle'))
        // this.menulist = newMenu
        // sessionStorage.setItem('menu-router', JSON.stringify(newMenu))
      }
    }
  }
})